package ca.usherbrooke.domus.sipnmove.call.view.impl;

import ca.usherbrooke.domus.sipnmove.call.impl.SocketCall;
import ca.usherbrooke.domus.sipnmove.useragent.controller.ActionController;

/**
 * Send socket message action controller
 */
public class SendSocketMessageActionController implements ActionController {

	/**
	 * SIP/Socket call view
	 */
	private SipSocketCallView sipSocketCallView;

	/**
	 * Socket call
	 */
	private SocketCall socketCall;
	
	@Override
	public void doAction() {
		String message = sipSocketCallView.getMessageTextField().getText();
		socketCall.sendMessage(message);
		
		sipSocketCallView.getMessageTextField().setText("");
	}

	/**
	 * @return the sipSocketCallView
	 */
	public SipSocketCallView getSipSocketCallView() {
		return sipSocketCallView;
	}

	/**
	 * @param sipSocketCallView the sipSocketCallView to set
	 */
	public void setSipSocketCallView(SipSocketCallView sipSocketCallView) {
		this.sipSocketCallView = sipSocketCallView;
	}

	/**
	 * @return the socketCall
	 */
	public SocketCall getSocketCall() {
		return socketCall;
	}

	/**
	 * @param socketCall the socketCall to set
	 */
	public void setSocketCall(SocketCall socketCall) {
		this.socketCall = socketCall;
	}

}
